package org.activitiDdemo;

import org.activiti.engine.IdentityService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

public class Test {
    private static final Logger LOGGER = LoggerFactory.getLogger(Test.class);

    public static void main(String[] args) {
        try {


            //创建流程引擎
            ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
            IdentityService identityService = processEngine.getIdentityService();

            Group group = identityService.newGroup("group1");
            group.setName("组1");
            group.setType("group");
//        identityService.saveGroup(group);

            User user = identityService.newUser("125");
            user.setFirstName("user1");
//        identityService.saveUser(user);

            User user2 = identityService.newUser("126");
            user2.setFirstName("user2");
//        identityService.saveUser(user2);

//            identityService.createMembership("125", "group1");
//            identityService.createMembership("126", "group1");
            identityService.deleteMembership("125", "3");
            identityService.deleteMembership("126", "3");

        } finally {
            System.exit(0);
        }

    }
}
